package com.zhuss.meeting.apply;

import com.zhuss.bean.bo.meeting.room.GetSituationBo;
import com.zhuss.common.AbstractBo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.meeting.apply.DetailApplyBo;
import com.zhuss.bean.bo.meeting.apply.SearchApplyBo;
import com.zhuss.bean.bo.meeting.apply.SearchCheckBo;
import com.zhuss.common.ReadService;
import com.zhuss.exception.WpsException;
import com.zhuss.meeting.processor.ApplyRead;

/**
 * @Author: zhushanshuo
 * @Date: 2020/2/12 19:31
 */
@Component("applyReadService")
public class ApplyReadService implements ReadService<Object,Object>{

    @Autowired
    @Qualifier("applyRead")
    private ApplyRead applyRead;

    @Override
    public Object detail(Object o) throws WpsException {
        DetailApplyBo bo = (DetailApplyBo) o;
        Object result = applyRead.detail(bo.getApplyId());
        return result;
    }

    /**
     * 申请列表
     * @throws WpsException
     */
    @Override
    public Object list(Object o) throws WpsException {
        SearchApplyBo bo = (SearchApplyBo) o;
        Object result = applyRead.list(bo);
        return result;
    }

    /**
     * 获取待审批列表
     * @throws WpsException
     */
    public Object listCheck(Object o) throws WpsException {
        SearchCheckBo bo = (SearchCheckBo) o;
        Object result = applyRead.listCheck(bo);
        return result;
    }

    /**
     * 获取已审批列表
     * @throws WpsException
     */
    public Object listApproved(Object o) throws WpsException {
        SearchCheckBo bo = (SearchCheckBo) o;
        Object result = applyRead.listApproved(bo);
        return result;
    }

    /**
     * 获取会议室百分比
     * @param o
     * @return
     * @throws WpsException
     */
    public Object getRoomPercentage(AbstractBo o) throws WpsException {
        Object result = applyRead.getRoomPercentage(o);
        return result;
    }

    /**
     * 获取会议室状态
     * @param o
     * @return
     * @throws WpsException
     */
    public Object getRoomStatus(GetSituationBo o) throws WpsException {
        Object result = applyRead.getRoomStatus(o);
        return result;
    }

}
